<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Linux," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="命令：passwd语法：1passwd [username] &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;创建完账户后，默认是没有设置密码的，虽然没有密码，但该账户同样登录不了系统。只有设置好密码后才能登录系统。为用户创建密码时，为了安全起见，尽量设置复杂一些。&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;">
<meta name="keywords" content="Linux">
<meta property="og:type" content="article">
<meta property="og:title" content="Linux 修改用户密码">
<meta property="og:url" content="https://hcldirgit.github.io/2017/09/03/1. Linux 基础/10. Linux passwd 修改用户密码/index.html">
<meta property="og:site_name" content="失落的乐章">
<meta property="og:description" content="命令：passwd语法：1passwd [username] &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;创建完账户后，默认是没有设置密码的，虽然没有密码，但该账户同样登录不了系统。只有设置好密码后才能登录系统。为用户创建密码时，为了安全起见，尽量设置复杂一些。&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2017-09-01T08:11:40.648Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Linux 修改用户密码">
<meta name="twitter:description" content="命令：passwd语法：1passwd [username] &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;创建完账户后，默认是没有设置密码的，虽然没有密码，但该账户同样登录不了系统。只有设置好密码后才能登录系统。为用户创建密码时，为了安全起见，尽量设置复杂一些。&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://hcldirgit.github.io/2017/09/03/1. Linux 基础/10. Linux passwd 修改用户密码/"/>





  <title>Linux 修改用户密码 | 失落的乐章</title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', '85*****1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?87980c**************99ec5e26fb5";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>











  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">失落的乐章</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">技术面前，永远都是学生。</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-external-link"></i> <br />
            
            留言
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="https://hcldirgit.github.io/2017/09/03/1. Linux 基础/10. Linux passwd 修改用户密码/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="失落的乐章">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/0.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="失落的乐章">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Linux 修改用户密码</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-09-03T01:55:11+08:00">
                2017-09-03
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="命令：passwd"><a href="#命令：passwd" class="headerlink" title="命令：passwd"></a>命令：passwd</h2><h3 id="语法："><a href="#语法：" class="headerlink" title="语法："></a>语法：</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">passwd [username]</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;创建完账户后，默认是没有设置密码的，虽然没有密码，但该账户同样登录不了系统。只有设置好密码后才能登录系统。为用户创建密码时，为了安全起见，尽量设置复杂一些。<br>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;可以按照这样的规则来设置密码：      </p>
<ol>
<li>长度大于10个字符；</li>
<li>密码中包含大小写字母数字以及特殊字符 ‘*’ ，‘&amp;’ ，‘%’ 等；</li>
<li>不规则性（不要出现 root 、happy 、love 、linux 、7758520 、111111 等等单词或者数字）；</li>
<li>不要带有自己的名字、公司名字、自己电话、自己生日等。</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">[root@localhost ~]<span class="comment"># passwd</span></div><div class="line">更改用户 root 的密码 。</div><div class="line">新的 密码：</div><div class="line">重新输入新的 密码：</div><div class="line">passwd： 所有的身份验证令牌已经成功更新。</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;“passwd” 后面不加 username 则是修改当先账户的密码。如果登录的是 root 账户，后面可以跟普通用户的名字，意思是修改指定账户的密码。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">[root@localhost ~]<span class="comment"># passwd user11</span></div><div class="line">更改用户 user11 的密码 。</div><div class="line">新的 密码：</div><div class="line">重新输入新的 密码：</div><div class="line">passwd： 所有的身份验证令牌已经成功更新。</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;只有 root 用户才可以修改其他账户的密码，普通账户只能修改自己的密码，其他账户的密码是不可以修改的。</p>
<h3 id="passwd-几个比较重要的参数"><a href="#passwd-几个比较重要的参数" class="headerlink" title="passwd 几个比较重要的参数"></a>passwd 几个比较重要的参数</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div></pre></td><td class="code"><pre><div class="line">[root@localhost beinan]<span class="comment"># passwd --help</span></div><div class="line">Usage: passwd [OPTION...] &lt;accountName&gt;</div><div class="line">-k, --keep-tokens       keep non-expired authentication tokens    注：保留即将过期的用户在期满后能仍能使用；</div><div class="line">-d, --delete            delete the password <span class="keyword">for</span> the named account (root only)    注：删除用户密码，仅能以root权限操作；</div><div class="line">-l, --lock              lock the named account (root only)    注：锁住用户无权更改其密码，仅能通过root权限操作；</div><div class="line">-u, --unlock            unlock the named account (root only)    注：解除锁定；</div><div class="line">-f, --force             force operation    注：强制操作；仅root权限才能操作；</div><div class="line">-x, --maximum=DAYS      maximum password lifetime (root only)          注：两次密码修正的最大天数，后面接数字；仅能root权限操作；</div><div class="line">-n, --minimum=DAYS      minimum password lifetime (root only)     注：两次密码修改的最小天数，后面接数字，仅能root权限操作；</div><div class="line">-w, --warning=DAYS      number of days warning users receives before     注：在距多少天提醒用户修改密码；仅能root权限操作；</div><div class="line">password expiration (root only)</div><div class="line">-i, --inactive=DAYS     number of days after password expiration when an     注：在密码过期后多少天，用户被禁掉，仅能以root操作；</div><div class="line">account becomes disabled (root only)</div><div class="line">-S, --status            report password status on the named account (root       注：查询用户的密码状态，仅能root用户操作；</div><div class="line">only)</div><div class="line">--stdin                 <span class="built_in">read</span> new tokens from stdin (root only)</div></pre></td></tr></table></figure>
<h2 id="命令：mkpasswd"><a href="#命令：mkpasswd" class="headerlink" title="命令：mkpasswd"></a>命令：mkpasswd</h2><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;这个命令经常用来生成密码，省的去想。默认 Linux 是没有这个命令的，需要安装一个包 “expect” ，如果 CentOS 可以上网，也可以使用命令完成安装。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">yum install -y expect</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;安装好后，输入命令：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">[root@localhost ~]<span class="comment"># mkpasswd</span></div><div class="line">HXut8oy*8</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;生成的随机字符串就可以作为一个密码，只不过这个密码不容易记忆。</p>
<h2 id="锁定和解锁某个账户"><a href="#锁定和解锁某个账户" class="headerlink" title="锁定和解锁某个账户"></a>锁定和解锁某个账户</h2><h3 id="锁定账户语法"><a href="#锁定账户语法" class="headerlink" title="锁定账户语法"></a>锁定账户语法</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">passwd -l username</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;让某个账户不能修改密码，可以用 -l 参数来锁定:</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line">[root@localhost ~]<span class="comment"># passwd -l beinan 注：锁定用户beinan不能更改密码；</span></div><div class="line">Locking password <span class="keyword">for</span> user beinan.</div><div class="line">passwd: Success           注：锁定成功；</div><div class="line">[beinan@localhost ~]<span class="comment"># su beinan 注：通过su切换到beinan用户；</span></div><div class="line">[beinan@localhost ~]$ passwd 注：beinan来更改密码；</div><div class="line">Changing password <span class="keyword">for</span> user beinan.</div><div class="line">Changing password <span class="keyword">for</span> beinan</div><div class="line">(current) UNIX password: 注：输入beinan的当前密码；</div><div class="line">passwd: Authentication token manipulation error 注：失败，不能更改密码；</div></pre></td></tr></table></figure>
<h3 id="解锁账户语法"><a href="#解锁账户语法" class="headerlink" title="解锁账户语法"></a>解锁账户语法</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">passwd -u username</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;注意：这两个用法只有 root 账户才有资格执行。</p>
<h2 id="清除账户密码"><a href="#清除账户密码" class="headerlink" title="清除账户密码"></a>清除账户密码</h2><h3 id="语法"><a href="#语法" class="headerlink" title="语法"></a>语法</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">passwd -d username</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;例：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">[root@localhost ~]<span class="comment"># passwd -d beinan 注：清除beinan用户密码；</span></div><div class="line">Removing password <span class="keyword">for</span> user beinan.</div><div class="line">passwd: Success                        注：清除成功；</div><div class="line">[root@localhost ~]<span class="comment"># passwd -S beinan 注：查询beinan用户密码状态；</span></div><div class="line">Empty password.                     注：空密码，也就是没有密码；</div><div class="line"></div><div class="line">注意： 当我们清除一个用户的密码时，登录时就无需密码；这一点要加以注意</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;注意：当清除一个账户的密码时，登录时就无需密码;这一点要嫁衣注意；</p>
<h2 id="密码时效命令：chage"><a href="#密码时效命令：chage" class="headerlink" title="密码时效命令：chage"></a>密码时效命令：chage</h2><h3 id="语法-1"><a href="#语法-1" class="headerlink" title="语法"></a>语法</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">chage [选项] [username]</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;chage 命令的选项说明：<br>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-m days： 密码可更改的最小天数。为零时代表任何时候都可以更改密码。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-M days： 指定口令有效的最多天数。当该选项指定的天数加上-d选项指定的天数小于当前的日期时，用户在使用该帐号前就必须改变口令。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-d days： 指定从1970年1月1日起，口令被改变的天数。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-I days： 指定口令过期后，帐号被锁前不活跃的天数。如果值为0，帐号在口令过期后就不会被锁。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-E date： 指定帐号被锁的日期。日期格式YYYY-MM-DD。若不用日期，也可以使用自1970年1月1日后经过的天数。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-W days： 指定口令过期前要警告用户的天数。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-l： 列出指定用户当前的口令时效信息，以确定帐号何时过期。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;例如：要求用户 user1 两天内不能更改口令，并且口令最长的存活期为30天，并且口令过期前5天通知用户</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">chage -m 2 -M 30 -W 5 user1</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;可以使用如下命令查看用户 user1 当前的口令时效信息：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">chage -l user1</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;提示：   </p>
<ol>
<li>可以使用 <code>chage [用户名]</code> 进入交互模式修改用户的口令时效。</li>
<li>修改口令实质上就是修改影子口令文件 <code>/etc/shadow</code> 中与口令时效相关的字段值。</li>
</ol>
<h2 id="chage-修改用户密码有限期限的命令"><a href="#chage-修改用户密码有限期限的命令" class="headerlink" title="chage 修改用户密码有限期限的命令"></a>chage 修改用户密码有限期限的命令</h2><h3 id="chage-语法格式"><a href="#chage-语法格式" class="headerlink" title="chage 语法格式"></a>chage 语法格式</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">chage [-l] [-m 最小天数] [-M 最大天数] [-W 警告] [-i 失效日] [-E 过期日] [-d 最后日]  username</div></pre></td></tr></table></figure>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Linux/" rel="tag"># Linux</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/09/03/1. Linux 基础/1. Linux 简介/" rel="next" title="Linux 简介">
                <i class="fa fa-chevron-left"></i> Linux 简介
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/09/03/1. Linux 基础/39.yum局域网软件源搭建/" rel="prev" title="yum局域网软件源搭建">
                yum局域网软件源搭建 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/0.png"
               alt="失落的乐章" />
          <p class="site-author-name" itemprop="name">失落的乐章</p>
           
              <p class="site-description motion-element" itemprop="description">失落的乐章的Blog</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/">
                <span class="site-state-item-count">627</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">38</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/hcldirgit" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#命令：passwd"><span class="nav-number">1.</span> <span class="nav-text">命令：passwd</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#语法："><span class="nav-number">1.1.</span> <span class="nav-text">语法：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#passwd-几个比较重要的参数"><span class="nav-number">1.2.</span> <span class="nav-text">passwd 几个比较重要的参数</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#命令：mkpasswd"><span class="nav-number">2.</span> <span class="nav-text">命令：mkpasswd</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#锁定和解锁某个账户"><span class="nav-number">3.</span> <span class="nav-text">锁定和解锁某个账户</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#锁定账户语法"><span class="nav-number">3.1.</span> <span class="nav-text">锁定账户语法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#解锁账户语法"><span class="nav-number">3.2.</span> <span class="nav-text">解锁账户语法</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#清除账户密码"><span class="nav-number">4.</span> <span class="nav-text">清除账户密码</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#语法"><span class="nav-number">4.1.</span> <span class="nav-text">语法</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#密码时效命令：chage"><span class="nav-number">5.</span> <span class="nav-text">密码时效命令：chage</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#语法-1"><span class="nav-number">5.1.</span> <span class="nav-text">语法</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#chage-修改用户密码有限期限的命令"><span class="nav-number">6.</span> <span class="nav-text">chage 修改用户密码有限期限的命令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#chage-语法格式"><span class="nav-number">6.1.</span> <span class="nav-text">chage 语法格式</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">失落的乐章</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  






  





  

  

  

  

  

  

</body>
</html>
